{{#each entityLogic.bpmnDiagram.importParams as |param|}}
{{param.drlString}}
{{/each}}
{{#each entityLogic.bpmnDiagram.globalParams as |param|}}
global {{param.type}} _{{param.identifier}}
{{/each}}
global {{packageName}}.util.domain.DELogic.Context srfdelogiccontext;
global org.apache.commons.logging.Log logger;
import {{packageName}}.util.domain.DELogic;
import {{packageName}}.util.helper.GlobalLogicHelper;

{{#each entityLogic.logicNodeModels as |logicNodeModel|}}
    {{#unless (or (eq logicNodeType 'BEGIN')  (eq logicNodeType 'END') (eq logicNodeModel.logicNodeType "DELOGIC") )}}
no-loop
rule "{{logicNodeModel.globalCodeName}}"
ruleflow-group "{{logicNodeModel.globalCodeName}}"
    when
    $delogic : DELogic()
    then
    {{# if (eq logicNodeModel.logicNodeType "PREPAREPARAM")}}
    {{> @macro/logic/drools/PrepareParam.hbs logicNodeModel=logicNodeModel}}
    {{else if (eq logicNodeModel.logicNodeType "RESETPARAM")}}
    {{> @macro/logic/drools/ResetParam.hbs logicNodeModel=logicNodeModel}}
    {{else if (eq logicNodeModel.logicNodeType "COPYPARAM")}}
    {{> @macro/logic/drools/CopyParam.hbs logicNodeModel=logicNodeModel}}
    {{else if (eq logicNodeModel.logicNodeType "BINDPARAM")}}
    {{> @macro/logic/drools/BindParam.hbs logicNodeModel=logicNodeModel}}
    {{else if (eq logicNodeModel.logicNodeType "SORTPARAM")}}
    {{> @macro/logic/drools/SortParam.hbs logicNodeModel=logicNodeModel}}
    {{else if (eq logicNodeModel.logicNodeType "RENEWPARAM")}}
    {{> @macro/logic/drools/RenewParam.hbs logicNodeModel=logicNodeModel}}
    {{else if (eq logicNodeModel.logicNodeType "DEBUGPARAM")}}
    {{> @macro/logic/drools/DebugParam.hbs logicNodeModel=logicNodeModel}}
    {{else if (eq logicNodeModel.logicNodeType "APPENDPARAM")}}
    {{> @macro/logic/drools/AppendParam.hbs logicNodeModel=logicNodeModel}}
    {{else if (eq logicNodeModel.logicNodeType "DEACTION")}}
    {{> @macro/logic/drools/DEAction.hbs logicNodeModel=logicNodeModel}}
    {{else if (eq logicNodeModel.logicNodeType "DEDATAQUERY")}}
    {{> @macro/logic/drools/DEDataQuery.hbs logicNodeModel=logicNodeModel}}
    {{else if (eq logicNodeModel.logicNodeType "DEDATASET")}}
    {{> @macro/logic/drools/DEDataSet.hbs logicNodeModel=logicNodeModel}}
    {{else if (eq logicNodeModel.logicNodeType "LOOPSUBCALL")}}
    {{> @macro/logic/drools/LoopSubCall.hbs logicNodeModel=logicNodeModel}}
    {{else if (eq logicNodeModel.logicNodeType "DENOTIFY")}}
    {{> @macro/logic/drools/DENotify.hbs logicNodeModel=logicNodeModel}}
    {{else if (eq logicNodeModel.logicNodeType "STARTWF")}}
    {{> @macro/logic/drools/StartWF.hbs logicNodeModel=logicNodeModel}}
    {{else if (eq logicNodeModel.logicNodeType "CANCELWF")}}
    {{> @macro/logic/drools/CancelWF.hbs logicNodeModel=logicNodeModel}}
    {{else if (eq logicNodeModel.logicNodeType "DELOGIC")}}
    {{!-- 处理逻辑通过子流程实现，调用子流程bpmn，不执行drl --}}
    {{else if (eq logicNodeModel.logicNodeType "SYSLOGIC")}}
    {{> @macro/logic/drools/SysLogic.hbs logicNodeModel=logicNodeModel}}
    {{else if (eq logicNodeModel.logicNodeType "SUBSYSSAMETHOD")}}
    {{> @macro/logic/drools/SubSysMethod.hbs logicNodeModel=logicNodeModel}}
    {{else if (eq logicNodeModel.logicNodeType "RAWWEBCALL")}}
    {{> @macro/logic/drools/RawWebCall.hbs logicNodeModel=logicNodeModel}}
    {{else if (eq logicNodeModel.logicNodeType "RAWSQLCALL")}}
    {{> @macro/logic/drools/RawSQLCall.hbs logicNodeModel=logicNodeModel}}
    {{else if (eq logicNodeModel.logicNodeType "RAWSQLANDLOOPCALL")}}
    {{> @macro/logic/drools/RawSQLAndLoopCall.hbs logicNodeModel=logicNodeModel}}
    {{else if (eq logicNodeModel.logicNodeType "SYSDBTABLEACTION")}}
    {{> @macro/logic/drools/SysDBTableAction.hbs logicNodeModel=logicNodeModel}}
    {{else if (eq logicNodeModel.logicNodeType "RAWSFCODE")}}
    {{> @macro/logic/drools/RawSFCode.hbs logicNodeModel=logicNodeModel}}
    {{else if (eq logicNodeModel.logicNodeType "SFPLUGIN")}}
    {{> @macro/logic/drools/SFPlugin.hbs logicNodeModel=logicNodeModel}}
    {{else if (eq logicNodeModel.logicNodeType "THROWEXCEPTION")}}
    {{> @macro/logic/drools/ThrowException.hbs logicNodeModel=logicNodeModel}}
    {{else if (eq logicNodeModel.logicNodeType "LOOPSUBCALL")}}
    {{> @macro/logic/drools/LoopSubCall.hbs logicNodeModel=logicNodeModel}}
    {{else if (eq logicNodeModel.logicNodeType "END")}}
    {{> @macro/logic/drools/End.hbs logicNodeModel=logicNodeModel}}
    {{else}}
        //未支持的处理节点
    {{/if}}

    {{#unless logicNodeModel.logicNodeType "THROWEXCEPTION"}}
    update($delogic);
    {{/unless}}
    end

    {{/unless}}
{{/each}}



